package org.example.hansp.collection_.set_;


import java.util.Map;

@SuppressWarnings({"all"})
/*
* 数组和链表的结合演示，hashSet的底层是HashMap
* HashMap的底层是数组+链表+红黑树
* */
public class HashSetStructure {
    public static void main(String[] args) {

        Node[] table = new Node[10];
        Node lim = new Node("Lim", null);
        table[2] = lim;

        Node frank = new Node("Frank", null);
        lim.next = frank;
       /* Node rose = new Node("Rose", null);
        frank.next = rose;*/
        frank.next = new Node("Rose", null);
        for (Node node : table) {
            System.out.println(node);
        }

/*List list = Arrays.asList(table);
        System.out.println(list);*/
    }
}

class Node {
    Object item;
    Node next;

    public Node(Object item, Node next) {
        this.item = item;
        this.next = next;
    }

    @Override
    public String toString() {
        return "Node{" +
                "item=" + item +
                ", next=" + next +
                '}';
    }
}